/*
 * @Author: zhanglianchang
 * @Date: 2020-08-01 14:39:32
 * @Last Modified by: taoshiwei
 * @Last Modified time: 2019-04-29 14:49:44
 *
 * 题库有关的接口：自己写吧~~  已经被张老师删了 ^_^
 */
// 引入封装好的API接口
import { createAPI } from '@/utils/request'

// 获取组题列表中的数据
export const getQuestionsRandoms = data => createAPI('/questions/randoms/', 'get', data)

// 删除数据
export const delQuestionsRandoms = data => createAPI(`/questions/randoms/${data.id}`, 'DELETE', data)

// 题库弹出层
export const getQuestionsRandomsID = data => createAPI(`/questions/${data.id}`, 'get', data)

// 获取题库列表
export const getQuestionsList = data => createAPI('/questions', 'get', data)

// 获取题库详情
export const getQuestionsId = id => createAPI(`/questions/${id}`, 'get')

// 修改题库
export const editQuestions = id => createAPI(`/questions/${id}`, 'put')

// 删除题库
export const delQuestions = id => createAPI(`/questions/${id}`, 'DELETE')

// 加入精选
export const addChoice = (id, choiceState) => createAPI(`/questions/choice/${id}/${choiceState}`, 'PATCH')
